/**
	License:		Artistic license 2.0 (see license.txt, also available online at http://www.perlfoundation.org/artistic_license_2_0)
	Authors:		OrbitalLab (http://www.orbitallab.ru/moonglide/), 2007-2009

	File:			MoonFile.d
	Description:	main MoonGlide file i/o, also has public imports of tango file stuff
	Date:			8.04.2008 by Digited
**/
module moonglide.io.MoonFile;

public import
	tango.io.model.IConduit,
	tango.io.model.IBuffer,
	tango.io.vfs.model.Vfs,

	tango.io.device.File,
	tango.io.FileScan,
	tango.io.FilePath,
	tango.io.stream.Buffered,
	tango.io.device.Array,

	tango.io.vfs.FileFolder,
	tango.io.vfs.ZipFolder,
	tango.io.vfs.LinkedFolder;

//=============================================================
/// MoonFile - main MoonGlide file i/o
//=============================================================
class CMoonFile
{
	protected:
		static this()
		{
			fs = new LinkedFolder( "app" );
		}

		this() {} // protected

		~this()
		{
			foreach( inout driver; drivers )
				delete driver;

			delete fs;
		}

	public:
		static char[]				programDirectory;		/// basic directory for relative filepaths
		static char[]				currentPath;			/// path we're working with (dir or file)
		static VfsFolder[ char[] ]	drivers;				/// filesystems: local, root, archives, ftp etc

		static LinkedFolder			fs;						/// main filesystem for mounting local fs and archives

		static LinkedFolder			opCall() { return fs; }	/// for ease of use. CMoonFile().file( path ) and nothing more!
}
